package week5;

public class ProductTester {
    public static void main(String[] args) {
        ProductList a = new ProductList();
        a.addToRear(new Product("英语四级真题",12.9));
        a.addToRear(new Product("奥利奥草莓夹心",15.6));
        a.addToRear(new Product("晨光自动笔",5));
        a.addToFront(new Product("农夫山泉",2));
        a.addToFront(new Product("笔记本",5));
        Product b = new Product("康师傅干脆面",2.5);
        a.addToFront(b);
        System.out.println("输出列表：");
        System.out.println(a.toString());

        System.out.println("删除康师傅干脆面：");
        a.remove(b);
        System.out.println(a.toString());

        System.out.println("选择排序：");
        a.selectionSort();
        System.out.println(a.toString());

        System.out.println("列表中是否存在康师傅干脆面：");
        System.out.println(a.contains(b));

        System.out.println("查找晨光自动笔: ");
        System.out.println( a.find("晨光自动笔"));
    }
}
